package yadong.example.code.jaxb;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;

public class LocationEvent {
	private String eventId;
	private String dateAbstract;
	private String[] dateArray;
	private String description;
	private String hours;
	private Category category;
	private String[] showTimeArray;
	private String startDate;
	private String title;
	private ArrayList<Occurrence> occurences;
	public LocationEvent() {
		
	}
	public LocationEvent(String val) {
		this.eventId=val;
		this.dateAbstract=val;
		this.dateArray=new String[]{val,val,val};
		this.showTimeArray=new String[]{val,val,val};
		this.description=val;
		this.hours=val;
		this.category = new Category(val);
		this.startDate=val;
		this.title=val;		
		this.occurences = new ArrayList<Occurrence>();
		this.occurences.add(new Occurrence(val));
		this.occurences.add(new Occurrence(val));
		this.occurences.add(new Occurrence(val));
	}
	public LocationEvent(String eventId,
						 String dateAbstract,
						 String[] dateArray,
						 String[] showTimeArray,
						 Category cat,
						 String description,
						 String hours,
						 String startDate,
						 String title,
						 ArrayList<Occurrence> occs) {
		this.eventId=eventId;
		this.dateAbstract=dateAbstract;
		this.dateArray=dateArray;
		this.showTimeArray=showTimeArray;
		this.description=description;
		this.hours=hours;
		this.category = cat;
		this.startDate=startDate;
		this.title=title;		
		this.occurences = occs;
	}
	public String getEventId() {
		return eventId;
	}
	public void setEventId(String eventId) {
		this.eventId = eventId;
	}
	public String getDateAbstract() {
		return dateAbstract;
	}
	public void setDateAbstract(String dateAbstract) {
		this.dateAbstract = dateAbstract;
	}
	
	@XmlElementWrapper(name="dates")
	@XmlElement(name="date")
	public String[] getDateArray() {
		return dateArray;
	}
	public void setDateArray(String[] dateArray) {
		this.dateArray = dateArray;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getHours() {
		return hours;
	}
	public void setHours(String hours) {
		this.hours = hours;
	}

	public Category getCategory() {
		return category;
	}
	public void setCategory(Category category) {
		this.category = category;
	}
	
	@XmlElementWrapper(name="showtimes")
	@XmlElement(name="showtime")
	public String[] getShowTimeArray() {
		return showTimeArray;
	}
	public void setShowTimeArray(String[] showTimeArray) {
		this.showTimeArray = showTimeArray;
	}
	public String getStartDate() {
		return startDate;
	}
	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	
	@XmlElementWrapper(name="occurrences")
	@XmlElement(name="occurrence")
	public ArrayList<Occurrence> getOccurences() {
		return occurences;
	}
	public void setOccurences(ArrayList<Occurrence> occurences) {
		this.occurences = occurences;
	}

}
